#ifndef DOCUMENTCONTAINER_H
#define DOCUMENTCONTAINER_H

#include <QObject>

class Document;

typedef QList<QPointer<Document> > DocumentList;

class DocumentContainer : public QObject
{
    Q_OBJECT
public:
    explicit DocumentContainer(QObject *parent = 0);

    QPointer<Document> createDocument();
    void setActiveDocument(QPointer<Document> doc);

    QPointer<Document> activeDocument() const;
    const DocumentList& documents() const;

    void removeDocument(QPointer<Document> doc);
private:
    DocumentList m_documents;
    QPointer<Document> m_activeDocument;
public slots:

signals:
    void currentDocumentAboutToChange();
    void currentDocumentChanged();
};

#endif // DOCUMENTCONTAINER_H
